<template>
	<view :class="['vh100',{'dark':theme == 'dark'}]">
		<view class="plr10 ptb10">
			<view class="tc mb10 ft16 pt10">{{title}}</view>
			<view v-html="news"></view>
			<view class="mt30 pr15 ft12 tr blue4">{{time}}</view>
		</view>
	</view>
</template>

<script>
	import {mapState,mapActions,mapGetters} from 'vuex';
	import {myMixins} from '@/common/myMixins.js'
	export default{
		mixins:[myMixins],
		data(){
			return{
				id:1,
				news:'',
				time:'',
				title:''
			}
		},
		computed:{
			...mapState({
			  theme:state=>state.theme
			}),
		},
		onLoad(option) {
			uni.setNavigationBarTitle({
				title:this.$t('home').detail
			})
			this.$utils.setTheme(this.theme);
			this.id = option.id;
			
			this.getDetail(option.id);
		},
		methods:{
			getDetail(id){
				this.$utils.initDataToken({url:'common/newsDetail',data:{id:id},type:'post'},(res,msg)=>{
					this.news = res.content;
					this.time = res.createTime;
					this.title = res.title;
				})
			}
		}
	}
</script>

<style>
</style>
